<template>
	<view class="">
		<view class="content">
			<view class="type-tab-head">
				<view class="type-head">
					<view class="type-tab-item" :class="{'active': currentTabIndex == 0}" @click="currentTabIndex=0">买涨</view>
					<view class="type-tab-item" :class="{'active': currentTabIndex == 1}" @click="currentTabIndex=1">买跌</view>
				</view>
				<view class="tb-head">
					<view class="tb-head-item">币种</view>
					<view class="tb-head-item">开仓价</view>
					<view class="tb-head-item">张数</view>
					<view class="tb-head-item">最新价</view>
					<view class="tb-head-item text-align-r">已结算盈亏</view>
				</view>
			</view>
			<view class="tb-content">
				<block v-if="currentTabIndex == 0">
					<view class="table-tr" v-for="(item, index) in transactionLists" :key="index">
						<view class="table-tr-td fz25 text-align-l">
							<view class="">BTC <text class="convertible">/USDT</text></view>
							<view class="time">07-9  14:23</view>
						</view>
						<view class="table-tr-td">2.784 BTC</view>
						<view class="table-tr-td">{{item.amount}}</view>
						<view class="table-tr-td">
							<view class="">75.6042</view>
							<view class="time">￥ 517.81</view>
						</view>
						<view class="table-tr-td text-align-r" :class="{'red': item.direction=='买涨', 'green': item.direction=='买跌'}">+5.61 USDT</view>
					</view>
				</block>
			</view>
		</view>
		<tabbar-diy :isIndex="4" :isInner="true"></tabbar-diy>
	</view>
</template>

<script>
	let _self;
	import tabbarDiy from '../../../components/tabbar-diy.vue'
	export default {
		data() {
			return {
				isIndex: 4,
				currentTabIndex: 0,
				transactionLists: [
					{time: '2/23 00:58', direction: '买跌', period: 'M30', isWin: '中', amount: 4.9999},
					{time: '2/23 00:58', direction: '买涨', period: 'M30', isWin: '中', amount: 4.9999},
					{time: '2/23 00:58', direction: '买跌', period: 'M30', isWin: '不中', amount: 4.9999},
					{time: '2/23 00:58', direction: '买涨', period: 'M30', isWin: '中', amount: 4.9999},
					{time: '2/23 00:58', direction: '买涨', period: 'M30', isWin: '不中', amount: 4.9999},
					{time: '2/23 00:58', direction: '买跌', period: 'M30', isWin: '不中', amount: 4.9999},
					{time: '2/23 00:58', direction: '买跌', period: 'M30', isWin: '不中', amount: 4.9999},
					{time: '2/23 00:58', direction: '买跌', period: 'M30', isWin: '不中', amount: 4.9999},
					{time: '2/23 00:58', direction: '买跌', period: 'M30', isWin: '不中', amount: 4.9999},
					{time: '2/23 00:58', direction: '买跌', period: 'M30', isWin: '不中', amount: 4.9999},
					{time: '2/23 00:58', direction: '买跌', period: 'M30', isWin: '不中', amount: 4.9999},
					{time: '2/23 00:58', direction: '买跌', period: 'M30', isWin: '不中', amount: 4.9999},
					{time: '2/23 00:58', direction: '买跌', period: 'M30', isWin: '不中', amount: 4.9999},
					{time: '2/23 00:58', direction: '买涨', period: 'M30', isWin: '中', amount: 5.9999}
				],
			}
		},
		components:{
			tabbarDiy
		},
		onShow(){
			console.log(11)
		},
		onLoad() {
			_self = this;
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.content{
		color: #FFFFFF;
		padding-top: 165rpx;
		padding-bottom: 120rpx;
		min-height: 100vh;
		box-sizing: border-box;
		background-color: #151F2A;
	}
	.type-tab-head{
		width: 100%;
		height: 145rpx;
		padding-top: 20rpx;
		background-color: #151F2A;
		border-bottom: 3rpx solid #071724;
		position: fixed;
		top: 0rpx;
		left: 0;
		z-index: 4;
		
		.type-head{
			width: 244rpx;
			margin: 0 auto;
			border: 1px solid #0DD4BB;
			border-radius: 6rpx;
			display: flex;
			justify-content: center;
		}
		
		.type-tab-item{
			width: 50%;
			height: 47rpx;
			line-height: 47rpx;
			text-align: center;
			font-size: 25rpx;
			
			&.active{
				background-color: #0DD4BB;
			}
		}
		.tb-head{
			height: 65rpx;
			margin-top: 30rpx;
			padding: 0 32rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			color: #7592B4;
			font-size: 24rpx;
			
			.tb-head-item{
				width: 20%;
			}
		}
	}
	.text-align-l{
		text-align: left;
	}
	.text-align-r{
		text-align: right;
	}
	.tb-content{

		.table-tr{
			height: 104rpx;
			box-sizing: border-box;
			padding: 28rpx 32rpx 0;
			display: flex;
			justify-content: space-between;
			font-size: 24rpx;
			border-bottom: 2rpx solid #071724;
			font-family: 'fzyt_GBK';
		}
		.table-tr-td{
			width: 20%;
			
			.convertible{
				display: inline-block;
				color: #7592B4;
				transform: scale(0.72);
				transform-origin: 0% 100%;
				margin-left: 6rpx;
			}
			.time{
				color: #7592B4;
				margin-top: 6rpx;
				transform: scale(0.8);
				transform-origin: 0% 50%;
			}
			
			&.red{
				color: #FF0600;
			}
			&.green{
				color: #0DD4BB;
			}
		}
		.fz25{
			font-size: 25rpx;
		}
	}
</style>
